import request from '@/utils/request';
import { Region } from './region';

// 查询点位管理列表
export function listNode(query) {
  return request({
    url: '/manage/node/list',
    method: 'get',
    params: query
  });
}

// 查询点位管理详细
export function getNode(id) {
  return request({
    url: '/manage/node/' + id,
    method: 'get'
  });
}

// 新增点位管理
export function addNode(data) {
  return request({
    url: '/manage/node',
    method: 'post',
    data: data
  });
}

// 修改点位管理
export function updateNode(data) {
  return request({
    url: '/manage/node',
    method: 'put',
    data: data
  });
}

// 删除点位管理
export function delNode(id) {
  return request({
    url: '/manage/node/' + id,
    method: 'delete'
  });
}

export interface Node {
  id?: number;
  nodeName?: string;
  address?: string;
  businessType?: number;
  region?: Region;
  partnerName?: string;
  regionId?: number;
  partnerId?: number;
  createTime?: string;
  updateTime?: string;
  createBy?: string;
  updateBy?: string;
  remark?: string;
}

export interface NodeForm {
  id?: number | null;
  nodeName?: string | null;
  address?: string | null;
  businessType?: number | null;
  regionId?: number | null;
  partnerId?: number | null;
  createTime?: string | null;
  updateTime?: string | null;
  createBy?: string | null;
  updateBy?: string | null;
  remark?: string | null;
}
